<style>
    #billboy{
        font-size: 14px;
        width: 760px;
    }
    #userdetail{
        border-bottom: 1px solid #000000;
        line-height: 36px;
        padding-left: 20px;
        padding-bottom: 10px;
    }
    #packdetail{
        border-bottom: 1px solid #000000;
        line-height: 36px;
        padding-left: 20px;
        padding-bottom: 10px;
    }
    #shipments{
        border-bottom: 1px solid #000000;
        line-height: 36px;
        padding-left: 20px;
        padding-bottom: 10px;
    }
    #formto{
        line-height: 36px;
        padding-left: 20px;
        padding-bottom: 10px;
    }
    #billboy table td{
        border: 1px solid #CCCCCC;
    }
    #packdetail table td{
        border: 1px solid #CCCCCC;
    }
    #bf{
        background-color: #eee;
        text-align: right;
        width: 150px;
    }
    #cf{
        width: 200px;
    }
    
</style>
<?php
if($this->bugma == 2){
    echo '<script language="javascript" type="text/javascript">alert("问题运单处理成功！");location.href = "/admini/managewaybill/index/"; </script>';
}else if($this->bugma == 22){
    echo '<script language="javascript" type="text/javascript">alert("只有待受理、待发货和发货中的运单才能出现问题！");location.href = "/admini/managewaybill/index/"; </script>';
}else if($this->bugma == 6){
    echo '<script language="javascript" type="text/javascript">alert("发生未知错误，请重新操作！");location.href = "/admini/managewaybill/index/"; </script>';
}
?>
<div id='billboy'>
    <div id='userdetail'>
        用户信息
        <table width="720" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td id='bf'>运单号：</td>
              <td id='cf' colspan="3">&nbsp;&nbsp;<?php echo $this->billall->billNo;?></td>
            </tr>
            <tr>
              <td id='bf'>所属用户：</td>
              <td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->user->nikename;?></td>
              <td id='bf'>仓库号：</td>
              <td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->user->storeno;?></td>
            </tr>
            <tr>
              <td id='bf'>运单提交时间：</td>
              <td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->dateCreated;?></td>
              <td id='bf'>运单发货时间：</td>
              <td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->dateSend;?></td>
            </tr>
          </table>
    </div>
    <div id="packdetail">
        运单信息
        <table width="720" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td id='bf'>包裹数量：</td><td id='cf'>&nbsp;&nbsp;<?php echo count($this->storedetail);?></td>
              <td id='bf'>发货国家：</td><td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->UserCity->name;?></td>
            </tr>
            <tr>
              <td id='bf'>运送方式：</td><td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->ShipTypeBy->name;?></td>
              <td id='bf'>是否去吊牌：</td><td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->isNoLogo==1?"是":"否";?></td>
            </tr>
           <tr>
              <td id='bf'>是否去包装：</td><td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->isNoSkin==1?"是":"否";?></td>
              <td id='bf'>是否压缩：</td><td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->isCompress==1?"是":"否";?></td>
            </tr>
            <tr>
              <td id='bf'>收货人：</td><td colspan="3" id='cf'>&nbsp;&nbsp;<?php echo $this->billall->consignee;?></td>
            </tr>
            <tr>
              <td id='bf'>电话：</td><td colspan="3" id='cf'>&nbsp;&nbsp;<?php echo $this->billall->conTel;?></td>
            </tr>
            <tr>
              <td id='bf'>邮编：</td><td colspan="3" id='cf'>&nbsp;&nbsp;<?php echo $this->billall->conPostCode;?></td>
            </tr>
            <tr>
              <td id='bf'>地址：</td><td colspan="3" id='cf'>&nbsp;&nbsp;<?php echo $this->billall->conAdd;?></td>
            </tr>
            <tr>
              <td id='bf'>包裹详情：</td><td colspan="3" id='cf'>&nbsp;&nbsp;<?php foreach ($this->storedetail as $Item) { echo $Item->productName.','; }?></td>
            </tr>
        </table>
    </div>
    <div style="line-height: 30px;padding-left: 20px;border-bottom: 1px solid #000000;padding-bottom: 10px;">包裹信息
    <?php
        if($this->storedetail != ''){
        foreach ($this->storedetail as $Item) {?>
        
        <div id="billdetail">
            <table width="720"  border="1" cellpadding="0" cellspacing="0">
                <tr>
                  <td id='bf'>条形码：</td><td  id='cf'>&nbsp;&nbsp;<?php echo $Item->barcode;?></td>
                  <td colspan="2" rowspan="3" id='cf'><a href="<?= $this->cdn ?><?= is_file('big'.$Item->imageFile)?('/big'.$Item->imageFile):($Item->imageFile) ?>"  target="_blank"><img src="<?php echo $this->cdn;?><?php echo $Item->image;?>" style="width: 100px;height: 100px;margin-left: 120px;"/></a></td>
                </tr>
                <tr>
                  <td id='bf'>物流信息：</td><td id='cf'>&nbsp;&nbsp;<?php echo $Item->Logistics;?></td>
                </tr>
                <tr>
                  <td id='bf'>入库时间：</td><td id='cf'>&nbsp;&nbsp;<?php echo $Item->createdate;?></td>
                </tr>
                <tr>
                  <td id='bf'>包裹清单：</td><td colspan="3" id='cf'>&nbsp;&nbsp;<?php echo $Item->productName;?></td>
                </tr>
            </table>
        </div>
    <?php }}?>
    </div>
    <?php if($this->billall->status == Application_Model_wayBillItem::STATUS_Sended){?>
    <div id="shipments">
        发货信息
        <table width="720"  border="1" cellpadding="0" cellspacing="0">
                <tr>
                  <td id='bf'>实际重量： </td>
                  <td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->lastWeight;?>g</td>
                  <td id='bf'>实际体积重量：</td>
                  <td id='cf'>&nbsp;&nbsp;<?php echo $this->billall->lastWeight;?>g</td>
                </tr>
                <tr>
                  <td id='bf'>实际费用： </td>
                  <td id='cf'>&nbsp;&nbsp;￥<?php echo $this->billall->lastMoney;?></td>
                  <td id='bf'>成本费用：</td>
                  <td id='cf'>&nbsp;&nbsp;￥<?php echo $this->billall->costMoney;?></td>
                </tr>
                <tr>
                  <td id='bf'>发货代理商：</td>
                  <td colspan="3" id='cf'>&nbsp;&nbsp;<?php echo $this->billall->agentcompany->name;?></td>
                </tr>
                <tr>
                  <td id='bf'>发货渠道：</td>
                  <td colspan="3" id='cf'>&nbsp;&nbsp;<?php echo $this->billall->channer;?></td>
                </tr>
                <tr>
                  <td id='bf'>物流号：</td>
                  <td colspan="3" id='cf'>&nbsp;&nbsp;<?php echo $this->billall->logistics;?></td>
                </tr>
                <tr>
                  <td id='bf'>应退还费用：</td>
                  <td colspan="3" id='cf'>&nbsp;&nbsp;￥<span id="thmoney" style="margin-left:2px;color: red;"><?php echo $this->billall->refundMoney;?></span></td>
                </tr>
            </table>
    </div>
    <?php }?>
    <div id="formto">
        问题信息
        <form method="post"  >
            <table width="720"  border="1" cellpadding="0" cellspacing="0">
                <tr>
                  <td id='bf'>问题类型： </td>
                  <td colspan="3" id='cf'>&nbsp;&nbsp;<select id="status" name="status">
                          <option value="<?php echo Application_Model_wayBillItem::STATUS_Back;?>">海关退货</option>
                          <option value="<?php echo Application_Model_wayBillItem::STATUS_ExpressBack;?>">快递退包</option>
                          <option value="<?php echo Application_Model_wayBillItem::STATUS_NoAppect;?>">快递拒收</option>
                      </select></td>
                </tr>
                <tr>
                  <td id='bf'>问题信息：</td>
                  <td colspan="3" id='cf' height="110px" valign="middle" >&nbsp;&nbsp;<textarea id="remark" name="remark" cols="64" rows="6" style="resize:none;"></textarea></td>
                </tr>
                <tr>
                  <td colspan="4" align="center"><input type="hidden" id="billid" name="billid" value="<?php echo $this->billall->id;?>" />
                    <input type="hidden" id="operate" name="operate" value="billbug" />
                    <input type='submit' name="submit" id="submit" value="提交"  style="background-color: #FF8312;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px;"/>&nbsp;&nbsp;&nbsp;
                    &nbsp;&nbsp;&nbsp;<input type='reset' name="reset" id="reset" value="重置" style="background-color: #1668A4;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px;"/>&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="button" id="refo" naem="refo" value="返回" style="background-color: #1668A4;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px;" /></td>
                </tr>
            </table>
        </form>
    </div>
</div>
<script language='javascript'>
    $("#refo").click(function(){
       location.href = "/admini/managewaybill/index/"; 
    });
</script>